package com.agou.app.admin.business.menu.bo;

import org.hibernate.Session;
import org.hibernate.SessionFactory;

import com.agou.app.admin.business.menu.dao.AdminMenuDao;
import com.agou.app.admin.business.menu.vo.AdminMenuVo;
import com.agou.ssh.core.base.BOResultSet;
import com.agou.ssh.core.db.HibernateUtil;

public class TestAdminMenuBo {

	public static void main(String[] args) {
		TestAdminMenuBo bo = new TestAdminMenuBo();
		try {
			bo.test();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	public void test() throws Exception{
		
		SessionFactory sessionFactory = HibernateUtil.getSessionFactory();
		Session session = sessionFactory.openSession();
		
		AdminMenuDao dao = new AdminMenuDao();
		
		AdminMenuVo menuVo = new AdminMenuVo();
		menuVo.setNaviId(3);
		
		AdminMenuBo bo = new AdminMenuBo();
		//模拟注入
		bo.setJdbcSession(session);
		bo.setAdminMenuDao(dao);
		
		BOResultSet result = bo.queryMenu(menuVo);
		
		System.out.println("======================================================");
		
		System.out.println(result.getDataMapValueToStr("tree_html"));
		
		session.close();
		sessionFactory.close();
	}

}
